cmake_minimum_required(VERSION 3.12.0)

message( STATUS "==========================================================================\n" )
message( STATUS "project 'GSymbols' generation started" )

project("GSymbols" LANGUAGES C CXX)
set_property( GLOBAL PROPERTY USE_FOLDERS ON )
message( STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION})" )
message( STATUS "Compiler name: ${DETECTED_COMPILER}" )
message( STATUS "target system: ${CMAKE_SYSTEM_NAME} (${CMAKE_SYSTEM_VERSION})" )
message( STATUS "host system: ${CMAKE_HOST_SYSTEM_NAME} (${CMAKE_HOST_SYSTEM_VERSION})" )


#编译配置
include("cmake/compilers.cmake")

#版本设置
set(GSymbols_VERSION_MAJOR 0)
set(GSymbols_VERSION_MINOR 0)

configure_file(
    "${PROJECT_SOURCE_DIR}/GSymbolsConfig.h.in"
    "${PROJECT_BINARY_DIR}/GSymbolsConfig.h"
)
include_directories("${PROJECT_BINARY_DIR}")

#工程输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/Generate/bin/Debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/Generate/bin/Release)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/Generate/lib/Debug)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/Generate/lib/Release)


set(CMAKE_BUILD_TYPE "Debug")

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG})
elseif(${CMAKE_BUILD_TYPE} STREQUAL "Release")
    link_directories(${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE})
endif()

#依赖目录
set(SDK_DIR ${PROJECT_SOURCE_DIR}/SDKs)

#包含源码
add_subdirectory("SourceCode")